package com.bestcem.xm.ticket.controller.vo.ticket.config;

import com.alibaba.fastjson.JSONObject;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data;

import java.util.Date;
import java.util.List;

/**
 * @author liheng
 * @version v1.0
 * @date 2021/8/18 15:05
 */
@Data
public class TicketConfigInfoV3VO {
    @JsonProperty(value = "id")
    private String id;

    @JsonProperty(value = "ticketFlow")
    private List<TicketConfigFlowVO> ticketFlows;

    @JsonProperty(value = "followConfig")
    private List<TicketConfigFlowVO.FollowConfig> followConfigs;

    @JsonProperty(value = "ticketTemplate")
    private List<TicketConfigTemplateV2VO> ticketTemplates;

    @JsonProperty(value = "ticketRule")
    private List<TicketConfigRuleVO> ticketRules;

    /**
     * 工单详情，显示内容
     * 这个字段表中没有找到，先暂时定义为Object
     */
    @JsonProperty(value = "templateDetailFields")
    private List<TemplateDetailFieldVO> templateDetailFields;

    /**
     * 工单规则的条件
     */
    @JsonProperty(value = "condition")
    private TicketConfigRuleVO.Condition condition;

    /**
     * 工单通知配置
     */
    @JsonProperty(value = "ticketNotifyConfig")
    private List<TicketNotifyConfigVO> ticketNotifyConfigS;

    /**
     * 工单通知方式
     */
    @JsonProperty(value = "ways")
    private NotifySettingWayVO ways;

    /**
     * 状态规则(二次投放相关)list  (TicketRule 的 id 的 list)
     * 问卷项目->开启提醒->工单规则->具体工单规则->更多设置
     * ruleId => operation
     * 使用所有的key查询TicketRule表
     */
    @JsonIgnore
    private List<JSONObject> statusRuleJsonList;

    /**
     * 根据statusRuleListJson查询出的ticketRule，提供给前端查看
     */
    @JsonProperty(value = "statusruleList")
    private List<TicketConfigRuleVO> statusRuleList;

    @JsonProperty(value = "onlyNotifyConfig")
    private OnlyNotifyConfigVO onlyNotifyConfig;

    /**
     * 系统id
     */
    @JsonProperty(value = "sysId")
    private String sysId;
    /**
     * 组织id
     */
    @JsonProperty(value = "orgId")
    private String orgId;
    /**
     * 用户id
     */
    @JsonProperty(value = "userId")
    private String userId;

    /**
     * 问卷id
     */
    @JsonProperty(value = "surveyId")
    private String surveyId;

    /**
     * 工单流程id
     */
    @JsonProperty(value = "ticketFlowIds")
    private List<String> ticketFlowIds;

    /**
     * @see com.bestcem.xm.ticket.enums.TicketConfigCreateTriggerEnum
     */
    @JsonProperty(value = "createTrigger")
    private Integer createTrigger;

    /**
     * 预警id
     */
    @JsonProperty(value = "alertId")
    private String alertId;

    /**
     * 预警规则id
     */
    @JsonProperty(value = "alertRuleIds")
    private List<String> alertRuleIds;

    /**
     * 预警规则数量，默认为零
     */
    @JsonProperty(value = "alertRuleCount")
    private Integer alertRuleCount;

    /**
     * 是否
     */
    @JsonProperty(value = "onlyHasContact")
    private Boolean onlyHasContact;

    /**
     * 工单的生成规则列表
     */
    @JsonProperty(value = "ruleList")
    private List<String> ruleList;

    /**
     * 工单配置 标题
     */
    @JsonProperty(value = "title")
    private String title;

    /**
     * 工单配置状态
     *
     * @see com.bestcem.xm.ticket.enums.TicketConfigStateEnum
     */
    @JsonProperty(value = "state")
    private Integer state;

    /**
     * 工单的生成规则列表id  (TicketRule 的 id)
     */
    @JsonProperty(value = "ticketRuleId")
    private String ticketRuleId;

    /**
     * 是否需要跟进处理
     */
    @JsonProperty(value = "needDeal")
    private Boolean needDeal;

    /**
     * 至少需要一次提交记录
     */
    @JsonProperty(value = "needRecord")
    private Boolean needRecord;

    /**
     * 是否通知管理员
     */
    @JsonProperty(value = "remindAdmin")
    private Boolean remindAdmin;

    /**
     * 发送邮件的id
     */
    @JsonProperty(value = "smtp_id")
    private String smtpId;

    /**
     * 工单模板id
     */
    @JsonProperty(value = "ticketTemplateId")
    private String ticketTemplateId;

    /**
     * 工单通知配置id list
     */
    @JsonIgnore
    @JsonProperty(value = "ticketNotifyConfigIds")
    private List<String> ticketNotifyConfigIds;

    /**
     * 问卷code
     */
    @JsonProperty(value = "surveyCode")
    private String surveyCode;
    /**
     * 问卷题目
     */
    @JsonProperty(value = "surveyTitle")
    private String surveyTitle;
    /**
     * 问卷状态
     */
    @JsonProperty(value = "surveyStatus")
    private Integer surveyStatus;
    /**
     * 问卷创建人
     */
    @JsonProperty(value = "surveyCreator")
    private String surveyCreator;

    /**
     * 问卷是否有工单生成
     */
    @JsonProperty(value = "surveyHasticket")
    private Boolean surveyHasTicket;

    /**
     * 规则类型
     *
     * @see com.bestcem.xm.ticket.enums.TicketRuleTypeEnum
     */
    @JsonProperty(value = "rtype")
    private Integer type;

    /**
     * 邮件通知状态
     */
    @JsonProperty(value = "email_status")
    private Integer emailStatus;

    @JsonProperty(value = "record_flag")
    private Integer recordFlag = 1;
    @JsonProperty(value = "created_dt")
    private Date createdDate;
    @JsonProperty(value = "created_id")
    private String createdId;
    @JsonProperty(value = "updated_dt")
    private Date updatedDate;
    @JsonProperty(value = "updated_id")
    private String updatedId;
}
